package com.sm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sm.entity.Course;
import com.sm.entity.CourseScore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Cola
 * @description
 * @date 2022/2/4
 */

@Mapper
public interface CourseMapper extends BaseMapper<Course> {
    Integer selectCourse(@Param("courseId") Integer courseId,@Param("studentId") Integer studentId);

    void updateSelectedNum(@Param("courseId") Integer courseId, @Param("op") Integer op);

    Integer getCourseNum(@Param("courseId") Integer courseId);

    Integer getCourseMaxNum(@Param("courseId") Integer courseId);

    Integer getSelectStatus(@Param("courseId") Integer courseId,@Param("studentId") Integer studentId);

    Integer checkCourseExist(@Param("courseId") Integer courseId);

    List<Course> getCourseListForSelect();

    List<Course> getSelectedCourseList(@Param("studentId") Integer studentId);

    /**
    * @author cola
    * @description 学生用户获取个人已选课程数量
    * @date 2022/3/7
    */
    int getSelectedCoursesNum(@Param("studentId") Integer studentId);

    List<CourseScore> getCourseScores(@Param("studentId") Integer studentId);

    /**
    * @author cola
    * @description 查看课程已选数量
    * @date 2022/3/7
    */
    int getCourseSelectedNum();


    /**
     * @Description: 增加部分模块，注解方式版本不兼容
     * @Author: lpf
     * @Date: 2022/2/15
     */
//    @Select("SELECT * FROM smdb.course_list") //不兼容
    List<Course> getAllCourse();

    int cancelSelectCourse(@Param("courseId") Integer courseId,@Param("studentId") Integer studentId);

}
